package com.jyh.order.config;

import feign.Logger;
import feign.Retryer;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

@Configuration
public class OrderConfig {

//    @Bean
    Retryer retryer(){
        return new Retryer.Default(); //使用默认的重试规则，默认重试5次，每次重试间隔100ms,最大重试间隔为1秒
    }


    @Bean
    Logger.Level feignLoggerLevel() {
        return Logger.Level.FULL; //日志级别
    }

    @Bean
    @LoadBalanced //负载均衡
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }
}